﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ebookstore
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user"] != null)
            {
                if (((string)Session["user"]) == "admin")
                {
                    adminMenu.Visible = true;
                    logoutButton.Visible = true;
                }
                else
                {
                    userMenu.Visible = true;
                    logoutButton.Visible = true;
                }
            }
        }
        protected void showPage(object sender, EventArgs e)
        {
            Button button = sender as Button;
            if (button.Text == "Home")
            {
                Response.Redirect("Default.aspx");
            }
            else
                Response.Redirect(button.Text+".aspx");
        }
    }
}